import js from '@eslint/js'
import globals from 'globals'
import pluginVue from 'eslint-plugin-vue'
import { defineConfig } from 'eslint/config'
import eslintConfigPrettier from 'eslint-config-prettier'

export default defineConfig([
  js.configs.recommended,
  pluginVue.configs['flat/essential'],
  eslintConfigPrettier,

  // 下面是我自己的规则
  {
    files: ['**/*.{js,mjs,cjs,vue}'],
    languageOptions: { globals: globals.browser },
    rules: {
      'no-unused-vars': 'error',
      'no-undef': 'warn',
      'no-console': 'warn',
      'vue/multi-word-component-names': 'off',
    },
  },
])
